package com.sikaryofficial.backend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sikaryofficial.backend.domain.entity.PointsBalance;
import com.sikaryofficial.backend.mapper.PointsBalanceMapper;
import com.sikaryofficial.backend.service.IPointsBalanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 积分余额Service业务层处理
 *
 * @author qinjinyuan
 * @date 2023-10-27
 */
@Service
public class PointsBalanceServiceImpl extends ServiceImpl<PointsBalanceMapper, PointsBalance> implements IPointsBalanceService {
    @Autowired
    private PointsBalanceMapper pointsBalanceMapper;

    /**
     * 根据用户ID获取积分余额
     *
     * @param userId 用户ID
     * @return 积分余额
     */
    @Override
    public PointsBalance getPointsBalanceByUserId(Long userId) {
        return pointsBalanceMapper.getPointsBalanceByUserId(userId);
    }
}
